<% content_for :foot_scripts do%>
<%= tinymce :height => 300 %>
<% end %>
<div class="container">
	<div class="tabbable tabs-left" id="admin_bar">
		<%= render 'shared/admin_bar'%>
		<div class="tab-content">
			<h1> <%= t 'tao_san_pham_trong_danh_muc___', :danh_muc => @danh_muc_ngon_ngu.ten%> </h1>
			<% if flash.now[:loi].present? %>
			<p class="alert alert-error">
				<%= flash.now[:loi]%>
			</p>
			<% end %>
			<%= form_tag request.url, :id=> 'tao_san_pham', :class=> "tao_html" do %>
			<p>
				<%= label_tag :tieu_de, t("ten_san_pham") %>
				<%= text_field_tag :tieu_de, params[:tieu_de], :class => "tieu_de_slug"%>
			</p>
			<p>
				<%= label_tag :slug, t('url_san_pham') %>
				<%= text_field_tag :slug, params[:slug], :class => "slug_cho_tieu_de"%>
			</p>
			<p>
				<%= label_tag :hinh_anh, t('file_hinh_anh_san_pham') %>
				<%= text_field_tag :hinh_anh, params[:hinh_anh]%>
				<br />
				<a href="<%= admin_anh_duoc_upload_path %>" class="btn btn-small" target="_blank"><%= t'cac_anh_da_upload'%></a>
				<a href="<%= admin_upload_path %>" class="btn btn-small" target="_blank"><%= t'upload_anh_moi'%></a>
			</p>
			<div class="input-append">
				<%= text_field_tag :gia, params[:gia], :class=> "span2 text-right", :placeholder => t('gia_san_pham')%>
				<span class="add-on">VND</span>
			</div>
			<p>
				<%= label_tag :ngon_ngu, t('ngon_ngu_bai_viet') %>
				<%= select_tag(:ngon_ngu, options_for_select([['Tiếng Việt', "vi"], ['English', "en"]], params[:ngon_ngu].present? ? params[:ngon_ngu] : I18n.locale.to_s)) %>
			</p>
			<div>
				<%= label_tag :noi_dung, t('noi_dung_bai_viet') %>
				<p>
					<a href="<%= admin_anh_duoc_upload_path %>" class="btn btn-small" target="_blank"><%= t'cac_anh_da_upload'%></a>
					<a href="<%= url_for :action=>"upload", :controller => "main"%>" class="btn btn-small" target="_blank"><%= t 'upload_anh_moi'%></a>
				</p>
				<%= text_area_tag :noi_dung, params[:noi_dung], :class => "tinymce", :rows => 40, :cols => 120 %>
			</div>
			<p >
				<%= submit_tag t('tao_san_pham'), :class=>"btn btn-large btn-primary" %>
			</p>
			<% end %>
		</div>
	</div>
</div>
